import request from '@/utils/request'

export default{

    //保存课程信息
    saveCourseInfo(courseInfo){
        return request({
            url: '/admin/edu/course/saveCourseInfo',
            method: 'post',
            data:courseInfo
        })
    },
    //查询课程信息
    courseInfo(id){
        return request({
            url:`/admin/edu/course/getCourseInfo/${id}`,
            method:'get'
        })
    },
    //更新课程信息
    updateCourseInfo(courseInfo,id){
        return request({
            url:`/admin/edu/course/updateCourseInfo/${id}`,
            method:"put",
            data:courseInfo
        })
    },
    //查询发布课程信息的方法
    getPublishInfo(courseId){
        return request({
            url:`/admin/edu/course/getPublishInfo/${courseId}`,
            method:"get",
        })
    },
    publishCourse(courseId){
        return request({
            url:`/admin/edu/course/publishCourse/${courseId}`,
            method:"put"
        })
    }
}